/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ServiciosWeb;

import DAO.DaoDeposito;
import Modelo.Deposito;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author VMJorgeA
 */
@WebService(serviceName = "ServicioWeb")
public class ServicioWeb {

    /**
     * This is a sample web service operation
     */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "Validador")
    public Deposito Validador(@WebParam(name = "pin") String pin) {
        DaoDeposito dd = new DaoDeposito();
        for (Deposito d : dd.todosDepositos()) {
            if (d.getPin().equals(pin)) {
                return d;
            }
        }
        return null;
    }
}
